home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 2010 April / PCWorld0410.iso / hity wydania / Ubuntu 9.10 PL / karmelkowy-koliberek-desktop-9.10-i386-PL.iso / casper / initrd.lz / initrd / scripts / casper-bottom / 25configure_init < prev    next >
Encoding:
Text File  |  2009-10-28  |  1.9 KB  |  73 lines

  1. #!/bin/sh
  2.  
  3. PREREQ=""
  4. DESCRIPTION="Setting up init..."
  5.  
  6. . /scripts/casper-functions
  7.  
  8. prereqs()
  9. {
  10.        echo "$PREREQ"
  11. }
  12.  
  13. case $1 in
  14. # get pre-requisites
  15. prereqs)
  16.        prereqs
  17.        exit 0
  18.        ;;
  19. esac
  20.  
  21. log_begin_msg "$DESCRIPTION"
  22.  
  23. # Arrange for shells on virtual consoles, rather than login prompts
  24.  
  25. if [ -n "$USERNAME" ]; then
  26.     if [ -f /root/etc/inittab ]; then
  27.         sed -i -e "s|^\([^:]*:[^:]*:[^:]*\):.*getty.*\<\(tty[0-9]*\).*$|\1:/bin/login -f $USERNAME </dev/\2 >/dev/\2 2>\&1|" /root/etc/inittab
  28.     fi
  29.     if [ "/root/etc/init/tty*" != "$(echo /root/etc/init/tty*)" ]; then
  30.         for f in /root/etc/init/tty*; do
  31.             sed -i -e "s|^exec.*|exec /bin/login -f $USERNAME </dev/$(basename $f .conf) > /dev/$(basename $f .conf) 2>\&1|" $f
  32.         done
  33.         for x in $(cat /proc/cmdline); do
  34.             case $x in
  35.                 textonly|automatic-ubiquity|only-ubiquity|noninteractive)
  36.                     rm -f /root/etc/rc?.d/[SK]??[gkx]dm
  37.                     ;;
  38.             esac
  39.         done
  40.     fi
  41.  
  42.     # Since we use autologin, lastlog doesn't make sense on the console.
  43.     sed -i '/^[^#].*pam_lastlog\.so/s/^/# /' /root/etc/pam.d/login
  44. fi
  45.  
  46. # This has the nice side effect of the cron.{daily,weekly,monthly} jobs in
  47. # /etc/crontab remaining disabled, yet also not run by anacron
  48. if [ -x /root/usr/sbin/anacron ]; then
  49.     chroot /root dpkg-divert --add --rename --quiet /usr/sbin/anacron
  50.     ln -s /bin/true /root/usr/sbin/anacron
  51. fi
  52.  
  53. # No point, really
  54. rm -f /root/etc/rc?.d/[SK]??postfix
  55.  
  56. # Avoid clobbering the user's clock
  57. rm -f /root/etc/rc?.d/K??hwclock.sh
  58.  
  59. # Disable readahead since it doesn't play well with squashfs + unionfs
  60. # use chmod instead of mv to not trigger unionfs bugs.
  61. if [ -e /root/sbin/readahead-list ]; then
  62.     chmod -x /root/sbin/readahead-list
  63. fi
  64.  
  65. # Disable sreadahead too since we don't ship a pack file for it anyway, so
  66. # all we'll end up doing is profiling the live CD boot. sreadahead also
  67. # breaks partman occasionally by reading from its synchronisation FIFOs.
  68. rm -f /root/etc/init/sreadahead.conf
  69.  
  70. log_end_msg
  71.  
  72. exit 0
  73.